cmake_minimum_required(VERSION 3.13)

# initialize pico-sdk from GIT
# (note this can come from environment, CMake cache etc)
# set(PICO_SDK_FETCH_FROM_GIT on)

# https://github.com/raspberrypi/pico-sdk/blob/master/external/pico_sdk_import.cmake
# pico_sdk_import.cmake is a single file copied from this SDK
# initialize the SDK based on PICO_SDK_PATH
# note: this must happen before project()
include(pico_sdk_import.cmake)

project(c_project)

# initialize the Raspberry Pi Pico SDK
pico_sdk_init()

# rest of your project

add_executable(hello_world
    hello_world.c
)

# Add pico_stdlib library which aggregates commonly used features
target_link_libraries(hello_world pico_stdlib)

target_compile_definitions(hello_world PRIVATE
    PICO_ENTER_USB_BOOT_ON_EXIT=1
)

# create map/bin/hex/uf2 file in addition to ELF.
pico_add_extra_outputs(hello_world)
